/*  */
export const elDateOpt = {
    pickerOptAll : {
        shortcuts: [{
                text: "今天",
                onClick(picker) {
                    const end = new Date()
                    end.setTime(end.getTime())
                    end.setHours(23)
                    end.setMinutes(59)
                    end.setSeconds(59)
                    console.log(end, 115)
                    end.setTime(end.getTime())
                    const start = new Date()
                    start.setHours(0)
                    start.setMinutes(0)
                    start.setSeconds(0)
                    start.setTime(start.getTime())
                    picker.$emit("pick", [start, end])
                }
            },
            {
                text: "昨天",
                onClick(picker) {
                    const end = new Date()
                    end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
                    end.setHours(23)
                    end.setMinutes(59)
                    end.setSeconds(59)
                    console.log(end, 115)
                    end.setTime(end.getTime())
                    const start = new Date()
                    start.setHours(0)
                    start.setMinutes(0)
                    start.setSeconds(0)
                    start.setTime(
                        start.getTime() - 3600 * 1000 * 24 * 1
                    )
                    picker.$emit("pick", [start, end])
                }
            },
            {
                text: "最近7天",
                onClick(picker) {
                    const end = new Date()
                    end.setHours(23)
                    end.setMinutes(59)
                    end.setSeconds(59)
                    end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
                    const start = new Date()
                    start.setHours(0)
                    start.setMinutes(0)
                    start.setSeconds(0)
                    start.setTime(
                        start.getTime() - 3600 * 1000 * 24 * 7
                    )
                    picker.$emit("pick", [start, end])
                }
            },
            {
                text: "最近30天",
                onClick(picker) {
                    const end = new Date()
                    end.setHours(23)
                    end.setMinutes(59)
                    end.setSeconds(59)
                    end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
                    const start = new Date()
                    start.setHours(0)
                    start.setMinutes(0)
                    start.setSeconds(0)
                    start.setTime(
                        start.getTime() - 3600 * 1000 * 24 * 30
                    )
                    picker.$emit("pick", [start, end])
                }
            },
            {
                text: "最近90天",
                onClick(picker) {
                    const end = new Date()
                    end.setHours(23)
                    end.setMinutes(59)
                    end.setSeconds(59)
                    end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
                    const start = new Date()
                    start.setHours(0)
                    start.setMinutes(0)
                    start.setSeconds(0)
                    start.setTime(
                        start.getTime() - 3600 * 1000 * 24 * 90
                    )
                    picker.$emit("pick", [start, end])
                }
            }
        ]
    },
    pickerOptDef: {
        shortcuts: [{
                text: "今天",
                onClick(picker) {
                    const end = new Date()
                    end.setTime(end.getTime())
                    end.setHours(23)
                    end.setMinutes(59)
                    end.setSeconds(59)
                    console.log(end, 115)
                    end.setTime(end.getTime())
                    const start = new Date()
                    start.setHours(0)
                    start.setMinutes(0)
                    start.setSeconds(0)
                    start.setTime(start.getTime())
                    picker.$emit("pick", [start, end])
                }
            },
            {
                text: "昨天",
                onClick(picker) {
                    const end = new Date()
                    end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
                    end.setHours(23)
                    end.setMinutes(59)
                    end.setSeconds(59)
                    console.log(end, 115)
                    end.setTime(end.getTime())
                    const start = new Date()
                    start.setHours(0)
                    start.setMinutes(0)
                    start.setSeconds(0)
                    start.setTime(
                        start.getTime() - 3600 * 1000 * 24 * 1
                    )
                    picker.$emit("pick", [start, end])
                }
            },
            {
                text: "最近7天",
                onClick(picker) {
                    const end = new Date()
                    end.setHours(23)
                    end.setMinutes(59)
                    end.setSeconds(59)
                    end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
                    const start = new Date()
                    start.setHours(0)
                    start.setMinutes(0)
                    start.setSeconds(0)
                    start.setTime(
                        start.getTime() - 3600 * 1000 * 24 * 7
                    )
                    picker.$emit("pick", [start, end])
                }
            },
            {
                text: "最近30天",
                onClick(picker) {
                    const end = new Date()
                    end.setHours(23)
                    end.setMinutes(59)
                    end.setSeconds(59)
                    end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
                    const start = new Date()
                    start.setHours(0)
                    start.setMinutes(0)
                    start.setSeconds(0)
                    start.setTime(
                        start.getTime() - 3600 * 1000 * 24 * 30
                    )
                    picker.$emit("pick", [start, end])
                }
            },
        ]
    },

}
export default {
    elDateOpt
}
